using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
	public partial class ManageMap
		: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<Manage> {
		public ManageMap() {
			// table
			ToTable("mc_Manage", "dbo");

			// keys
			HasKey(t => t.Id);

			// Properties
			Property(t => t.Id)
				.HasColumnName("Id")
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
				.IsRequired();
			Property(t => t.RoleId)
				.HasColumnName("RoleId")
				.IsOptional();
            Property(t => t.MerchantId)
                .HasColumnName("MerchantId")
                .IsOptional();
            // Relationships
            HasOptional(t => t.Role)
				.WithMany()
				.HasForeignKey(d => d.RoleId)
				.WillCascadeOnDelete(false);
            //HasOptional(t => t.Merchant)
            //   .WithMany()
            //   .HasForeignKey(d => d.Merchant)
            //   .WillCascadeOnDelete(false);
        }
	}
}
